guard UTIME_NOW/UTIME_OMIT usages
authorDmitry Shachnev <mitya57@debian.org>
Wed, 19 Aug 2020 17:40:32 +0000 (18:40 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Wed, 19 Aug 2020 17:40:32 +0000 (18:40 +0100)
Forwarded: no
Last-Update: 2018-02-22

Gbp-Pq: Name nonlinux_utime.diff

qmake/library/ioutils.cpp
src/corelib/io/qfilesystemengine_unix.cpp

index d2171274d80952013bbd6f5f53d3fb4b8f231d4c..6fada0005779aff8c90b94f7da491db0983f04a8 100644 (file)
@@ -228,7 +228,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
         *errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
         return false;
     }
-#    if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
+#    if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L && defined(UTIME_NOW)
     const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
     const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0;
 #    else
index 38cb6a423dddc397312b21375fcc6eac01a74ea3..c224770f1dfd5177ca5820a5e9808afaa5041cac 100644 (file)
@@ -1375,7 +1375,7 @@ bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractF
         return false;
     }
 
-#if QT_CONFIG(futimens)
+#if QT_CONFIG(futimens) && defined(UTIME_OMIT)
     struct timespec ts[2];
 
     ts[0].tv_sec = ts[1].tv_sec = 0;